package com.example.fitnessapp.controller;


import com.example.fitnessapp.util.ApiResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/friend")
@RequiredArgsConstructor
public class FriendController {
    @PostMapping("/add")
    public ApiResponse<Void> addFriend(@RequestBody Map<String, String> req) {
        // TODO: 添加好友逻辑
        return ApiResponse.ok("添加成功");
    }

    @GetMapping("/list/{userId}")
    public ApiResponse<List<Map<String, Object>>> listFriends(@PathVariable String userId) {
        List<Map<String, Object>> friends = new ArrayList<>();
        Map<String, Object> f = new HashMap<>();
        f.put("friendId", "10002");
        f.put("nickname", "李四");
        f.put("avatar", "http://xxx.com/avatar.jpg");
        friends.add(f);
        return ApiResponse.ok("success", friends);
    }
}
